﻿CREATE PROCEDURE [dbo].[UpdatePatient]
	@medicalRecordNumber INT,
	@name NVARCHAR(50),	
	@gender NVARCHAR(10),
	@dateOfBirth DATE,
	@phoneNumber NVARCHAR(30),
	@emailAddress NVARCHAR(30),
	@homeAddressLine1 NVARCHAR(100),
	@homeAddressLine2 NVARCHAR(100),
	@homeAddressCity NVARCHAR(30),
	@homeAddressState NVARCHAR(30),
	@homeAddressPostalCode NVARCHAR(10)
AS
	UPDATE Patient
		SET	Name = @name,
			Gender = @gender,
			DateOfBirth = @dateOfBirth,
			PhoneNumber = @phoneNumber,
			EmailAddress = @emailAddress,
			HomeAddressLine1 = @homeAddressLine1,
			HomeAddressLine2 = @homeAddressLine2,
			HomeAddressCity = @homeAddressCity,
			HomeAddressState = @homeAddressState,
			HomeAddressPostalCode = @homeAddressPostalCode
		WHERE MedicalRecordNumber = @medicalRecordNumber
RETURN @@ROWCOUNT
